<template>
  <div id="components-layout-demo-basic">
    <a-layout>
      <a-layout-header>
        <a-menu v-model="current" mode="horizontal" class="menuEdit">
          <a-menu-item key="index" @click="changeMenu"> <a-icon type="home" />首页 </a-menu-item>
          <a-menu-item key="employee" @click="changeMenu">
            <i class="iconfont icon-tuijianzhiwei" />职位
          </a-menu-item>
          <a-menu-item key="school" @click="changeMenu">
            <a-popover>
              <template slot="content">
                <el-link href="http://zbjy.nuc.edu.cn/Chuangye/detail.html?id=af49b890-c630-a666-0fd1-edd741db24cf">就业创业网</el-link>
              </template>
              <a-icon type="appstore" />校园
            </a-popover>
          </a-menu-item>
          <a-menu-item key="company" @click="changeMenu">
            <i class="iconfont icon-gongsi" />公司
          </a-menu-item>
        </a-menu>
        <a-dropdown>
          <a-avatar class="u-avatar" :src="user.userImage" />
          <a-menu slot="overlay" style="margin-top: 5px; margin-left: 30px;">
            <a-menu-item>
              <a href="userCenter">个人中心</a>
            </a-menu-item>
            <a-menu-item>
              <a href="javascript:;">退出登录</a>
            </a-menu-item>
          </a-menu>
        </a-dropdown>
      </a-layout-header>
      <a-layout-content>
        <router-view />
      </a-layout-content>
      <a-layout-footer>
        Footer
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<script>
// @ is an alias to /src
export default {
  name: 'Home',
  data() {
    return {
      current: '',
      user: ''
    }
  },
  created() {
    // const _this = this
    // const userId = this.$route.params.userId
    // this.$store.state.userId = userId
    // this.$http.get('user/findOneUser?id=' + this.$store.state.userId).then(function(resp) {
    //   _this.user = resp.data
    // })
  },
  methods: {
    changeMenu: function(e) {
      console.log(e)
      if (e.key !== 'school') {
        this.current = e.key
        this.$router.push(e.key)
      }
    }
  }
}
</script>

<style scoped lang="scss">
@import url('../icons/home.css');

#components-layout-demo-basic {
  text-align: center;
}
#components-layout-demo-basic .ant-layout-header,
#components-layout-demo-basic .ant-layout-footer {
  display: flex;
  background: #FFFFFF;
  color: #fff;
  line-height: 50px;
  height: 50px;
}
#components-layout-demo-basic .ant-layout-header{
  .u-avatar{
    align-self: center;
  }
}
#components-layout-demo-basic .ant-layout-footer {
  line-height: 1.5;
}
#components-layout-demo-basic .ant-layout-content {
  color: #fff;
  min-height: 680px;
  width: 1184px;
  margin: 0 auto;
}
#components-layout-demo-basic > .ant-layout {
  margin-bottom: 48px;
}
#components-layout-demo-basic > .ant-layout:last-child {
  margin: 0;
}
  .menuEdit {
    width: 100%;
    line-height: 50px;
    height: 100%;
  }
.el-select .el-input {
  width: 200px;
}
.input-with-select .el-input-group__prepend {
  background-color: #fff;
}
</style>
